import { first, set } from 'lodash-es';
import { defineStore } from 'pinia';

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

export const useSubjectSelectStore = defineStore('subjectSelect', {
  state: () => ({
    homeData: {
      province: {},
      subjectList: [],
      subjectId: '', // 组合学科id
    },
    compareData: [],
    provinces: [],
    intelligenceSubject: [],
    intelligenceIndustry: {},
  }),
  actions: {
    setHomeData(data) {
      this.homeData = data;
    },
    setCompareData(data) {
      this.compareData = data;
    },
    setProvinces(data) {
      this.provinces = data;
    },
    setIntelligenceSubject(data) {
      this.intelligenceSubject = data;
    },
    setIntelligenceIndustry(data) {
      this.intelligenceIndustry = data;
    },
  },
  persist: true,
})